package functions.ems_base_data;

import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;
import com.crc.mam.BaseCase;
import com.sun.media.jfxmedia.logging.Logger;
import coms.Constants;
import coms.process.EmployeeLoanClaimProcess;
import frame.HttpHelper;

public class DebitAccountItem extends BaseCase {
  private org.slf4j.Logger logger = LoggerFactory.getLogger(DebitAccountItem.class);
  
  public void findDebitAccountItem(String buCode,String subcategoryCode,String  costCenterProperty,String orgCode) {
    String url = Constants.FIND_DEBIT_ACCOUNT_ITEM_URL;
    String params = "{\"buCode\":\""+buCode+"\",\"subcategoryCode\":\""+subcategoryCode+"\","
        + "\"costCenterProperty\":\""+costCenterProperty+"\",\"orgCode\":\""+orgCode+"\"}";
  
    try {
      result = HttpHelper.post(params, url);
      status = HttpHelper.isOk;
      logger.info("findDebitAccountItem --- " + result);
      if(status) {
        
      }else {
        try {
          JSONObject object = new JSONObject(result);
          remark = object.getString("message");
        }catch(JSONException e) {
          e.printStackTrace();
          remark = "JSON 解析错误";
        }
      }
    }catch(Exception e) {
      e.printStackTrace();
      remark = "系统异常";
      status = false;
    }
  }

}
